package com.it.common.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;


public class VerticalTextView extends androidx.appcompat.widget.AppCompatTextView {


    public VerticalTextView(Context context) {
        super(context);
    }
    public VerticalTextView( Context context ,AttributeSet attrs) {
        super(context, attrs);

    }
    @Override
    protected void onDraw(Canvas canvas) {
        Paint paint = getPaint();
        paint.setColor(getCurrentTextColor());

        canvas.save();

        canvas.translate(0, getHeight());
        canvas.rotate(-90);

        canvas.translate(getCompoundPaddingLeft(), getExtendedPaddingTop());

        getLayout().draw(canvas);
        canvas.restore();
    }
}